#!/bin/bash

#进入项目目录
cd /www/jekyll/H2O/

# 更新代码
git fetch --all

# 获取博客进程ID
PID=$(ps -ef | grep "ruby" | grep -v grep | awk '{ print $2 }')

if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill -9  $PID
fi

# 后台启动jekyll命令
nohup jekyll server 


